package com.zhudoo.zhilian.util.web;

/**
 * 业务异常
 *
 * @author wangnian
 */
public class BusinessException extends RuntimeException {
    /**
     * "NOT_AUTHORIZED": 没有权限
     * "NOT_CERTIFICATION": 没有实名认证
     * "INVALID": 无效
     * 异常CODE，用来判断
     */
    private String codeStr;

    private BusinessException(String msg) {
        super(msg);
        this.codeStr = "";
    }

    private BusinessException(String codeStr, String msg) {
        super(msg);
        this.codeStr = codeStr;
    }

    public String getCodeStr() {
        return codeStr;
    }

    public static BusinessException getInstance(String msg) {
        return new BusinessException(msg);
    }

    public static BusinessException getInstance(String codeStr, String msg) {
        return new BusinessException(codeStr, msg);
    }
}
